home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / PCL4C33.ARJ / DIR.C < prev    next >
Text File  |  1992-08-01  |  1KB  |  55 lines

  1. #include <stdio.h>
  2. #include  <dos.h>
  3.  
  4. #define FALSE 0
  5. #define TRUE !FALSE
  6. #define WORD unsigned int
  7.  
  8.  
  9. void setDTA(BufPtr)
  10. WORD BufPtr;
  11. {union REGS reg;
  12.  reg.x.dx = (WORD) BufPtr;
  13.  reg.h.ah = 0x1A;
  14.  int86(0x21, ®, ®);
  15. }
  16.  
  17. int FindFirst(FilePtr)
  18. int FilePtr; /* file spec */
  19. {union REGS reg;
  20.  reg.x.dx = FilePtr;
  21.  reg.h.ah = 0x4e;
  22.  reg.x.cx = 0;
  23.  int86(0x21, ®, ®);
  24.  if(reg.x.cflag) return(FALSE);
  25.  else return(TRUE);
  26. }
  27.  
  28. int FindNext()
  29. {union REGS reg;
  30.  reg.h.ah = 0x4f;
  31.  int86(0x21, ®, ®);
  32.  if(reg.x.cflag) return(FALSE);
  33.  else return(TRUE);
  34. }
  35.  
  36. int ChangeDir(DirPtr)
  37. int DirPtr;   /* directory */
  38. {union REGS reg;
  39.  reg.h.ah = 0x3b;
  40.  reg.x.dx = DirPtr;
  41.  int86(0x21, ®, ®);
  42.  if(reg.x.cflag) return(FALSE);
  43.  else return(TRUE);
  44. }
  45.  
  46. int CurrentDir(DirPtr)
  47. int DirPtr;   /* directory */
  48. {union REGS reg;
  49.  reg.h.ah = 0x47;
  50.  reg.x.si = DirPtr;
  51.  reg.h.dl = 0;
  52.  int86(0x21, ®, ®);
  53.  if(reg.x.cflag) return(FALSE);
  54.  else return(TRUE);
  55. }